<html>
<head><meta charset="utf-8"><title>late-bound regions error · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html">late-bound regions error</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="167305993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167305993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167305993">(Jun 04 2019 at 15:35)</a>:</h4>
<p>Hi <span class="user-mention" data-user-id="218608">@yodal</span> =)</p>



<a name="167306086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306086">(Jun 04 2019 at 15:36)</a>:</h4>
<p>Howdy</p>



<a name="167306133"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306133" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306133">(Jun 04 2019 at 15:36)</a>:</h4>
<p>So indeed relating bound regions is a sign that you are doing something wrong</p>



<a name="167306141"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306141" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306141">(Jun 04 2019 at 15:37)</a>:</h4>
<p>but I'm not sure where the problem is :)</p>



<a name="167306158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306158">(Jun 04 2019 at 15:37)</a>:</h4>
<p>I guess the first question is where the bound regions are coming from</p>



<a name="167306192"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306192" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306192">(Jun 04 2019 at 15:38)</a>:</h4>
<p>looking over <a href="https://github.com/rust-lang/rust/compare/master...yodaldevoid:issue-60813" target="_blank" title="https://github.com/rust-lang/rust/compare/master...yodaldevoid:issue-60813">your branch</a> they are clearly not introduced in the commits there</p>



<a name="167306256"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306256" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306256">(Jun 04 2019 at 15:38)</a>:</h4>
<p>I'm not 100% sure on what's going on with the const generics setup atm</p>



<a name="167306289"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306289" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306289">(Jun 04 2019 at 15:38)</a>:</h4>
<p>it's been on my to-do list to try and sync up and in particular work out the canonicalization plan etc but...</p>



<a name="167306330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167306330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167306330">(Jun 04 2019 at 15:39)</a>:</h4>
<p>do you have some debug printouts or something related to this error? i.e., showing a bit of context? what types are being related?</p>



<a name="167311184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167311184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167311184">(Jun 04 2019 at 16:23)</a>:</h4>
<p><a href="https://pastebin.com/dfY3NT16" target="_blank" title="https://pastebin.com/dfY3NT16">https://pastebin.com/dfY3NT16</a></p>



<a name="167311216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167311216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167311216">(Jun 04 2019 at 16:23)</a>:</h4>
<p>That is a log of the more pertinent debug messages.</p>



<a name="167311330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167311330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167311330">(Jun 04 2019 at 16:24)</a>:</h4>
<p>The types being related are a const generic that is supposed to be a <code>&amp;'static str</code> and a string literal passed as a const param</p>



<a name="167311391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167311391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167311391">(Jun 04 2019 at 16:25)</a>:</h4>
<p>the string literal in the const param position is the one with the bound region as far as I can tell</p>



<a name="167311710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167311710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167311710">(Jun 04 2019 at 16:29)</a>:</h4>
<p>My gut tells me that <code>check_user_type_annotations</code>, and by connection the <code>AscribeUserType</code> query, is not made to expect bound regions as before const generics the only regions that would be in user annotations would be early bounds, but I could easily be wrong about this</p>



<a name="167313153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167313153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Matthew Jasper <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167313153">(Jun 04 2019 at 16:46)</a>:</h4>
<p>What do they looks like with <code>-Zverbose</code>?</p>



<a name="167313791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167313791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167313791">(Jun 04 2019 at 16:53)</a>:</h4>
<p><a href="https://pastebin.com/ypC3txgE" target="_blank" title="https://pastebin.com/ypC3txgE">https://pastebin.com/ypC3txgE</a></p>



<a name="167321835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167321835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167321835">(Jun 04 2019 at 18:17)</a>:</h4>
<blockquote>
<p>My gut tells me that <code>check_user_type_annotations</code>, and by connection the <code>AscribeUserType</code> query, is not made to expect bound regions as before const generics the only regions that would be in user annotations would be early bounds, but I could easily be wrong about this</p>
</blockquote>
<p>I think that is correct <span class="user-mention" data-user-id="218608">@yodal</span> -- but I think in general there shouldn't be any bound regions there, at least not without a <code>Binder</code> somewhere</p>



<a name="167369684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167369684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167369684">(Jun 05 2019 at 08:56)</a>:</h4>
<p>After looking into it further, that region is not made within a <code>Binder</code>. It is made as part of the canonicalization leading into the <code>AscribeUserType</code> type_op/query. The relation that fails is then made within that type_op/query. The <code>ReLateBound</code> is created to replace a <code>ReVar</code> and is made at the base innermost binder index.</p>



<a name="167369932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167369932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167369932">(Jun 05 2019 at 09:00)</a>:</h4>
<p>It's late and so I can't dig any further right now. I might dig at this more tomorrow.</p>



<a name="167392619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167392619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167392619">(Jun 05 2019 at 14:16)</a>:</h4>
<p><span class="user-mention" data-user-id="218608">@yodal</span> I see -- yes, we do create binders there, but they should be instantiated -- it seems like the bug might be that this instantiation is not occurring</p>



<a name="167392623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167392623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167392623">(Jun 05 2019 at 14:16)</a>:</h4>
<p>I can help point you at the plces to add debug logs</p>



<a name="167396461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/late-bound%20regions%20error/near/167396461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/late-bound.20regions.20error.html#167396461">(Jun 05 2019 at 14:51)</a>:</h4>
<p>alright, that would be very helpful</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>